﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;

namespace LogisticsAndong
{
    public class PublicHelper
    {
        /// <summary>
        /// PING IP地址
        /// </summary>
        /// <param name="ip"></param>
        /// <returns></returns>
        public static bool PingIp(string ip)
        {
            bool result = false;
            try
            {
                Ping pingSend = new Ping();
                PingReply reply = pingSend.Send(ip, 2000);
                if (reply.Status == IPStatus.Success)
                    result = true;
            }
            catch (Exception)
            {
                result = false;
            }
            return result;
        }
    }
}
